define([],function(){
	var tpl = {};

	tpl.info = function(){
		return info();
	}
	tpl.tab = function(){
		return tab();
	}
	tpl.quest = function(){
		return quest();
	}
	tpl.scene = function(){
		return scene();
	}
	tpl.end = function(){
		return end();
	}
	tpl.definedMonth = function(){
		return definedMonth();
	}
	tpl.tip = function(){
		return tip();
	}
	tpl.empty = function(){
		return empty();
	}

	var info = function(){
		return 	'<script id="dstDetail_info" type="text/html">'+
				'	<div class="dstDetail-info clearfix">'+
				'		<div class="item">'+
				'			<span>姓名</span>'+
				'			<span>{{PatientInfo.userName}}</span>'+
				'		</div>'+
				'		<div class="item">'+
				'			<span>性别</span>'+
				'			<span>{{if PatientInfo.gender == "F"}}女{{else}}男{{/if}}</span>'+
				'		</div>'+
				'		<div class="item">'+
				'			<span>出生日期</span>'+
				'			<span>{{PatientInfo.birthday}}</span>'+
				'		</div>'+
				'		{{if prematureDelivery == "Y"}}'+
				'			<div class="item">'+
				'				<span>纠正年龄</span>'+
				'				<span>{{PatientInfo.correctAge}}</span>'+
				'			</div>'+
				'			<div class="item">'+
				'				<span>孕周</span>'+
				'				<span>{{PatientInfo.pregnancyWeekStr}}</span>'+
				'			</div>'+
				'		{{else}}'+
				'			<div class="item">'+
				'				<span>实际年龄</span>'+
				'				<span>{{ ageMonDayStr }}</span>'+
				'			</div>'+
				'		{{/if}}'+
				// 点击“查看”，出现的模态框里多出现的内容
				'		{{if flag}}'+
				'			<br/>'+
				'			<div class="item">'+
				'				<span>父亲姓名</span>'+
				'				<span>{{fatherName}}</span>'+
				'			</div>'+
				'			<div class="item">'+
				'				<span>母亲姓名</span>'+
				'				<span>{{motherName}}</span>'+
				'			</div>'+
				'			<div class="item">'+
				'				<span>家庭地址</span>'+
				'				<span>{{address}}</span>'+
				'			</div>'+
				'		{{/if}}'+
				'	</div>'+
				'</script>';
	}
	var tab = function(){
		return 	'<script id="dstDetail_tab" type="text/html">'+
				'	<ul class="tab-box clearfix">'+
				'		{{each list as value i}}'+
				'			<li>'+
				'				<div class="tab-month" data-monthId="{{value.id}}">{{value.month}}</div>'+
				'				<div class="tab-quest-box clearfix">'+
				'					{{each value.question as item j}}'+
				'						<span data-id="{{item.id}}" style="width:{{item.width}}">{{item.id}}</span>'+
				'					{{/each}}'+
				'				</div>'+
				'			</li>'+
				'		{{/each}}'+
				'	</ul>'+
				'</script>';
	}
	var quest = function(){
		return 	'<script id="dstDetail_quest" type="text/html">'+
				'	<div class="quest-tit"><div>{{id}}.{{name}}</div></div>'+
				'	<div class="quest-con">'+
				'		<div>'+
				'			{{if typeof standard == "string"}}'+
				'				{{standard}}'+
				'			{{else if typeof standard == "object"}}'+
				'				{{each standard as value i}}'+
				'					{{if typeof value == "string"}}'+
				'						{{value}}'+
				'					{{else if typeof value == "object"}}'+
				'						<img src="{{value.url}}">'+
				'					{{/if}}'+
				'				{{/each}}'+
				'			{{/if}}'+
				'		</div>'+
				'	</div>'+
				'	<div class="quest-resut clearfix" data-monthId="{{monthId}}" data-month="{{month}}" data-id="{{id}}" data-index="{{index}}" >'+
				'		<div class="quest-pass {{if answer=="1"}}active{{/if}}" data-result="1">'+
				'			<span>Pass</span>'+
				'			<span>成功</span>'+
				'		</div>'+
				'		<div class="quest-fail {{if answer=="0"}}active{{/if}}" data-result="0">'+
				'			<span>Fail</span>'+
				'			<span>失败</span>'+
				'		</div>'+
				'	</div>'+
				'</script>';
	}
	var scene = function(){
		return 	'<script id="dstDetail_scene" type="text/html">'+
				'	<div class="scene-top clearfix">'+
				'		<div class="scene-caption">情景</div>'+
				'		<div class="scene-title">{{if group}}{{group}}{{else}}无情景{{/if}}</div>'+
				'		<div class="scene-btn">结束</div>'+
				'	</div>'+
				'	<div  class="scene-con">'+
				'		{{if list.length > 0}}'+
				'		<ul class="item-wrap clearfix">'+
				'			{{each list as value i }}'+
				'			<li class="item" data-monthId="{{value.monthId}}" data-id="{{value.id}}" data-index="{{value.index}}">'+
				'				<div class="item-tit">'+
				'					<div>{{value.id}}.{{value.name}}</div>'+
				'				</div>'+
				'				<div class="item-content">'+
				'					<div>'+
				'						{{if typeof value.standard == "string"}}'+
				'							{{value.standard}}'+
				'						{{else if typeof value.standard == "object"}}'+
				'							{{each value.standard as item}}'+
				'								{{if typeof item == "string"}}'+
				'									{{item}}'+
				'								{{else if typeof item == "object"}}'+
				'									<img src="{{item.url}}">'+
				'								{{/if}}'+
				'							{{/each}}'+
				'						{{/if}}'+
				'					</div>'+
				'				</div>'+
				'				<div class="item-result clearfix">'+
				'					<div class="item-pass {{if value.answer=="1"}}active{{/if}}" data-result="1">'+
				'						<span>Pass</span>'+
				'						<span>成功</span>'+
				'					</div>'+
				'					<div class="item-fail {{if value.answer=="0"}}active{{/if}}" data-result="0">'+
				'						<span>Fail</span>'+
				'						<span>失败</span>'+
				'					</div>'+
				'				</div>'+
				'			</li>'+
				'			{{/each}}'+
				'		</ul>'+
				'		{{else}}'+
				'			<div class="scene-no">该题不属于任何场景</div>'+
				'		{{/if}}'+
				'	</div>'+
				'</script>';
	}
	var end = function(){
		return 	'<script id="dstDetail_end" type="text/html">'+
				'	<div class="dstDetail-msg">'+
				'		<div class="msg">{{typeName}}能区已做完</div>'+
				'		<div class="dstDetail-msg-btn">'+
				'			<div id="editPrev">修改上一题</div>'+
				'			{{if nextTypeName}}<div id="goNextType">进入{{nextTypeName}}能区</div>{{/if}}'+
				'			<div id="allEnd">全部结束</div>'+
				'		</div>'+
				'	</div>'+
				'</script>';
	}
	var definedMonth = function(){
		return 	'<script id="dstDetail_definedMonth" type="text/html">'+
				'	{{each list as value i}}'+
				'		<option value="{{value.id}}">{{value.month}}</option>'+
				'	{{/each}}'+
				'</script>';
	}
	var tip = function(){
		return 	'<script id="dstDetail_tip" type="text/html">'+
				'	<div class="dstDetail-msg">'+
				'		<div class="msg">找到0月还未找到顶部，默认当前0月为顶部，是否继续做题？</div>'+
				'		<div class="dstDetail-msg-btn">'+
				'			<div id="continueN">否，不做了</div>'+
				'			<div id="continueY">是，继续做</div>'+
				'		</div>'+
				'	</div>'+
				'</script>';
	}
	var empty = function(){
		return 	'<script id="dstDetail_empty" type="text/html">'+
				'	<div class="dstDetail-msg">'+
				'		<div class="msg">我们将<span class="color-red">清空</span>此前所有选项，并从新选的该年龄组重新开始评估。</div>'+
				'		<div class="dstDetail-msg-btn">'+
				'			<div id="emptyY">确认重新开始</div>'+
				'			<div id="emptyN">取消</div>'+
				'		</div>'+
				'		<p class="tip">*如想跳转其他题目，并不清空此前选项，可直接点击该“年龄组”</p>'+
				'	</div>'+
				'</script>';
	}

	return tpl;
});